GET /api/admin/learn/options
List of Options

Request headers

Only registered user can perform this action
  Authentication - string - required
    Example of Authentication header : "Bearer TOKEN_FETCHED_FROM_SERVER_DURING_REGISTRATION"

Success response body

[
  {
    "id": 1,
    "body": "Your Why",
    "correct_answer": true
  },
  ...
]

GET /api/admin/learn/questions/:question_id/options/:id
Option Info

Request headers

Only registered user can perform this action
  Authentication - string - required
    Example of Authentication header : "Bearer TOKEN_FETCHED_FROM_SERVER_DURING_REGISTRATION"

Success response body

{
  "id": 1,
  "body": "Your Why",
  "correct_answer": true
}

Params

Param name Description
question_id
required

Validations:

  • Must be a Integer

id
required

Validations:

  • Must be a Integer


POST /api/admin/learn/questions/:question_id/options
Create Option

Request headers

Only registered user can perform this action
  Authentication - string - required
    Example of Authentication header : "Bearer TOKEN_FETCHED_FROM_SERVER_DURING_REGISTRATION"

Request body example

{
  "option": {
    "body": "custom option",
    "position": 4,
    "correct_answer": true
  }
}

Success response body

{
  "id": 2,
  "body": "custom option",
  "correct_answer": true
}

Params

Param name Description
question_id
required

Validations:

  • Must be a Integer

option
required

Validations:

  • Must be a Hash

option[body]
required

Validations:

  • Must be a String

option[position]
required

Validations:

  • Must be a Integer

option[correct_answer]
required

Validations:

  • Must be one of: true, false, 1, 0.


PUT /api/admin/learn/questions/:question_id/options/:id
Update Option

Request headers

Only registered user can perform this action
  Authentication - string - required
    Example of Authentication header : "Bearer TOKEN_FETCHED_FROM_SERVER_DURING_REGISTRATION"

Request body example

{
  "option": {
    "body": "updated custom question",
    "position": 4,
    "correct_answer": false
  }
}

Success response body

{
  "id": 1,
  "body": "updated custom question",
  "correct_answer": false
}

Params

Param name Description
question_id
required

Validations:

  • Must be a Integer

id
required

Validations:

  • Must be a Integer

option
required

Validations:

  • Must be a Hash

option[body]
required

Validations:

  • Must be a String

option[position]
required

Validations:

  • Must be a Integer

option[correct_answer]
required

Validations:

  • Must be one of: true, false, 1, 0.


DELETE /api/admin/learn/questions/:question_id/options/:id
Destroy Option

Request headers

Only registered user can perform this action
  Authentication - string - required
    Example of Authentication header : "Bearer TOKEN_FETCHED_FROM_SERVER_DURING_REGISTRATION"

Success response body

{
  "success": true
}

Params

Param name Description
question_id
required

Validations:

  • Must be a Integer

id
required

Validations:

  • Must be a Integer